﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddNewUser.aspx.cs" Inherits="Liguo.Administration.AddNewUser" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>添加用户</title>
         <script type="text/javascript">
             function CheckInput(){
                 var usernamepass = true;
                 usernamepass = !isEmpty("UserName");
                 var mbpass = true;
                 mbpass = !isEmpty("MailBox");
                 var pwpass = true;
                 //pwpass = document.getElementById("PassWord1").!=0;
                 pwpass = !isEmpty("Password1");
                     if (!usernamepass) {
                         alert('请填写用户名');
                         return false;
                     }
                     if (!mbpass) {
                         alert('请填写邮箱');
                         return false;
                     } else if (!isValid("MailBox", /^\w{1,15}(?:@(?!-))(?:(?:[a-z0-9-]*)(?:[a-z0-9](?!-))(?:\.(?!-)))+[a-z]{2,4}$/)) {
                         alert('邮箱输入错误！');
                         return false;
                     }
                     if (!pwpass)
                     {
                         alert('请输入密码');
                         return false;
                     }
             }
             function isEmpty(name) {
                 return document.getElementById(name).value == "";
             }
             function isValid(name, pat) {
                 var s = document.getElementById(name).value;
                 return pat.exec(s);
             }
         </script>
</head>
<body>
    <b>添加用户</b><br>
   <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td> 
        <asp:Label ID="Label1" runat="server" Text="用户名:"></asp:Label></td>
                <td>
                    <asp:TextBox ID="UserName" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td> 
        <asp:Label ID="Label2" runat="server" Text="邮箱:"></asp:Label></td>
                <td><asp:TextBox ID="MailBox" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
        <asp:Label ID="Lable3" runat="server" Text="密码:"></asp:Label></td>
                <td>
                    <input id="Password1" type="password" runat="server"/>
                </td>
            </tr>
    </table>
         </div>
       <div>
          <asp:Button ID="submit" runat="server" Text="提交" OnClick="submit_C" OnClientClick="return CheckInput()"/>
       </div>
    </form>
</body>
</html>
